{% extends 'admin_base.html' %}
{% block title %} Settings: Change Password {% endblock %}

{% block main %}
<div class="row">
    <div class="col-md-10 col-md-offset-1">
        <ul class="nav nav-tabs">
          <li role="presentation"><a href="{{ url_for('accounts.settings' )}}">Profile</a></li>
          <li role="presentation" class="active"><a href="#" onclick="return false">Password</a></li>
        </ul>
    </div>
</div>
<br>
<div class="row">
    <div class="col-xs-6 col-sm-3"></div>
    <div class="col-xs-6 col-sm-6">
        {% import "_form.html" as forms %}
        <form method="POST" action="" id='password'>
        {{ forms.render(form) }}
            <button type="submit" class="btn btn-primary" name="update" value="update">Update</button>
        </form>

        <hr>

        {% if user.is_email_confirmed %}
            <blockquote>
                <p>Your email has been confirmed!</p>
            </blockquote>
        {% else %}
            <form method="POST" action="" id='confirm_email'>
                {% if email_resend_flag %}
                    {% set msg = 'Your confirmation email has been sent, click the button to resend email' %}
                    {% set button = 'Resend email' %}
                {% else %}
                    {% set msg = 'Click the button to send confirmation email' %}
                    {% set button = 'Confirm email' %}
                {% endif %}
                <blockquote><p>{{ msg }}</p>
                <button type="submit" class="btn btn-primary" name="email" value="email">{{ button }}</button>
                </blockquote>
            </form>
        {% endif %}

    </div>
</div>

{% endblock %}